how to use rank function in postgresql

join shbcf.ru